import produce from 'immer';
import {Action} from 'types';

export interface UIState {
  activeTab?: string;
}
export const initialState: Readonly<UIState> = {activeTab: ''};

export default (originalState = initialState, action: Action) =>
  produce(originalState, (state) => {
    switch (action.type) {
      case 'setActiveTab':
        state.activeTab = action.payload;
        return;
    }
  });
